#pragma once

#include "Game/Process/RenderProcess.h"
#include "Render/Texture/Picture2DTexture.h"
#include "Render/Texture/RenderTarget.h"
#include "Render/Tradition/RHIRenderPass.h"
#include "Render/Tradition/GraphicsPipeline.h"
#include "Render/Texture/ColorRenderTarget.h"
#include "Render/Texture/DepthRenderTarget.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"
#include "Render/Tradition/RHICommandBuffer.h"
#include "Render/Tradition/ComputePipeline.h"
#include "Render/Texture/CustomTexture.h"
#include "Render/Texture/RHISampler.h"

class LocalScene;
class LocalEntity;


class VoxelProcess : public RenderProcess
{
	DECLARE_PROCESS(VoxelProcess)

	struct PushConstants
	{
		glm::ivec3 voxelResolution;
	};

protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:


	RefCountPtr<RHITexture> mEmptyImage;

	uint32 mViewSize;

	LocalScene* mLocalScene;

	LocalEntity* mModelEntity;

	RefCountPtr<VertexBuffer> mVertexBuffer;

	RefCountPtr<IndexBuffer> mIndexBuffer;

	RefCountPtr<RHITexture> mVoxelOccupancy;

	RefCountPtr<RHITexture> mVoxelColor;

	RefCountPtr<RHIDescriptor> mDescriptor;

	DescriptorMask mDescriptorMask;

	RefCountPtr<GraphicsPipeline> mPipeline;

	RefCountPtr<RHIRenderPass> mRenderPass;

	RefCountPtr<RHIFrameBuffer> mFrameBuffer;

	RefCountPtr<RHICommandBuffer> mCommandBuffer;

	RefCountPtr<RHIFence> mFence;

};
